Towards a Generic Interface to Integrate CLP and Tabled Execution (Extended Abstract)

نویسندگان

  • Joaquín Arias
  • Manuel Carro
چکیده

Logic programming systems featuring Constraint Logic Programming (Jaffar and Ma-her 1994) and tabled execution (Tamaki and Sato 1986; Warren 1992) have been shown to increase the declarativeness and efficiency of Prolog, while at the same time making it possible to write very expressive programs. Previous implementations fully integrating both capabilities (i.e., forcing suspension, answer subsumption, etc. where it is necessary in order to avoid recomputation and terminate whenever possible) did not have a simple, well-documented, easy-to-understand interface which made it possible to integrate arbitrary CLP solvers into existing tabling systems. This clearly hinders a more widespread usage of this combination. In our work, we examine the requirements that a constraint solver must fulfill to be easily interfaced with a tabling system. We propose a minimal set of operations which the constraint solver has to provide to the tabling engine. These operations are based in only four objects (Vars, Dom, ProjStore and Store). Vars is a list with the constrained variables of a call. Dom and ProjStore are the representation of the projection of the constraint store of a call. Store is the representation of the constraint store of a generator and is used by the external constraint solver to reinstall it when the generator is complete. The two main operations to be provided by the solver are: (i) entailment, entail(+Vars A , +Dom A , +Dom B , +ProjStore B), which checks if the call/answer constraint store (Vars A and Dom A) is entailed by the previous call/answer constraint store (Dom B and ProjStore B) and (ii) projection, executed in two steps: project_domain(+Vars,-Dom), that pre-computes an object (Dom) used during the en-tailment, and project_gen_store(+Vars, +Dom,-ProjStore), which is executed when the entailment fails. The compiler performs a shallow program transformation adding tabled_call/1 to control the tabled execution and new_answer/0 to collect the answers. These two predicates invoke the operations of the interface during tabled execution. Fig. 1 contains a Prolog version of tabled_call/1 which specifies its implementation and the control flow of the execution. This specification shows that when a new call is entailed by a previous generator, its execution is suspended, unlike in usual tabling, where suspension happens only when variant calls are found. We validate experimentally our design with three use cases. First we re-engineer a

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Failure tabled constraint logic programming by interpolation

We present a new execution strategy for constraint logic programs called Failure Tabled CLP. Similarly to Tabled CLP our strategy records certain derivations in order to prune further derivations. However, our method only learns from failed derivations. This allows us to compute interpolants rather than constraint projection for generation of reuse conditions. As a result, our technique can be ...

متن کامل

Structural Information Analysis for CLP Languages

We present the rational construction of a generic domain for structural analysis of CLP languages: Pattern(D]), where the parameter D] is an abstract domain satisfying certain properties. Our domain builds on the parameterized domain for the analysis of Prolog programs Pat(<), which is due to Cortesi et al. [6, 7]. However, the formalization of our CLP abstract domain is independent from specif...

متن کامل

A Sketch of a Complete Scheme for Tabled Execution Based on Program Transformation

Tabled evaluation has proved to be an effective method to improve several aspects of goal-oriented query evaluation, including termination and complexity. “Native” implementations of tabled evaluation offer good performance, but also require significant implementation effort, affecting compiler and abstract machine. Alternatively, program transformation-based implementations, such as the origin...

متن کامل

TCHR: a framework for tabled CLP

Tabled Constraint Logic Programming is a powerful execution mechanism for dealing with Constraint Logic Programming without worrying about fixpoint computation. Various applications, e.g in the fields of program analysis and model checking, have been proposed. Unfortunately, a high-level system for developing new applications is lacking, and programmers are forced to resort to complicated ad ho...

متن کامل

STAN: A Static Analyzer for CLP(R) Based on Abstract Interpretation

Stan is an implementation of a static analysis for CLP(R) based on abstract interpretation. The semantics of the program is achieved using unfolding operator. The abstract domain is a space of convex poly-hedra. Three types of program analysis are implemented-backward, forward and combined.The results of the analysis can be used in program optimization. The implementation is complemented by a g...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015